﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using F_MODEL;
using F_BLL;

namespace MvcApplication1.Controllers
{
    public class DaiPiPeiController : zyl_LoginController
    {
        DaiPiPei_bll dbll = new DaiPiPei_bll();
        /// <summary>
        /// 待带货匹配
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="mailStatus"></param>
        /// <returns></returns>
        [HttpGet]
        public List<Mails> GetDaiPiPei(int mailStatus)
        {
            UserInfo m = new UserInfo();
            int userid = 0;
            m = mod();
            if (m != null)
                userid = m.userId;
            List<Mails> getmails = dbll.GetDaiPiPei(userid, mailStatus);
            return getmails;
        }
          [HttpGet]
        public int pipei(string mailId)
        {
            UserInfo m = new UserInfo();
            int userid = 0;
            m = mod();
            if (m != null)
                userid = m.userId;
           
            if (dbll.pipei(userid, mailId) == 1)
            {
                return 1;

            }
            else
            {
                return 0;
            }
        }
          [HttpGet]
          public int wancheng(string mailId)
          {
              UserInfo m = new UserInfo();
              int userid = 0;
              m = mod();
              if (m != null)
                  userid = m.userId;
              if (dbll.wancheng(userid, mailId) == 1)
              {
                  return 1;

              }
              else
              {
                  return 0;
              }
          }
       
        

        



    }
}
